package cn.com.czpb.client.module.personal.adapter;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import cn.com.czpb.client.R;
import cn.com.czpb.client.model.usercenter.MessageBean;
import cn.com.czpb.client.utils.TextUtils;

import java.util.List;

/**
 * Created by Administrator on 2017/8/11.
 */

public class ReplyAdapter extends BaseMultiItemQuickAdapter<MessageBean,BaseViewHolder> {
    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public ReplyAdapter(List<MessageBean> data) {
        super(data);
        addItemType(0,R.layout.item_message_recyclerview);
    }

    @Override
    protected void convert(BaseViewHolder helper, MessageBean item) {
        switch (helper.getItemViewType()){
            case 0:
                helper.setText(R.id.tv_reply_name, TextUtils.getLengthText(item.getReplyto().getNickname(),8));
                helper.setText(R.id.tv_reply_time,item.getReplyto().getCreate_time());
                helper.setText(R.id.tv_reply_content,item.getReplyto().getComment());
                break;
        }
    }
}
